package com.zhenyi.liuxue.interceptor;

import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;
import com.jfinal.core.Controller;

public class PermissionInterceptor implements Interceptor {

	@Override
	public void intercept(Invocation inv) {
		System.out.println("intercept");
		Controller c = inv.getController();
		// c.setAttr("hasRole", new HasRoleFreeMarkerMethod());
		// new HasRoleTag();
		// c.setAttr("hasAnyRoles", new HasAnyRolesFreeMarkerMethod());
		// c.setAttr("hasPermission", new HasPermissionFreeMarkerMethod());
		// c.setAttr("hasEditPermission", new
		// HasEditPermissionFreeMarkerMethod());
		inv.invoke();
	}

}
